'use strict';

const Controller = require('egg').Controller;

class evaluate extends Controller {
  async index() {
    const data = await this.ctx.service.evaluate.findAll(this.ctx);
    this.ctx.body = data;
  }
  async create() {
    const ctx = this.ctx;
    console.log(ctx)
    const params = ctx.request.body;
    const data = await ctx.service.evaluate.create(params)
    ctx.body = data;
  }
  async destroy() {
    const ctx = this.ctx;
    const evaluateId = ctx.params.id;
    const del = await ctx.service.evaluate.delete(evaluateId);
    ctx.body = del;
  }
  async update() {
    const ctx = this.ctx;
    const evaluateId = ctx.params.id;
    const params = ctx.request.body;
    const change = await ctx.service.evaluate.update(evaluateId, params);
    ctx.body = change;
  }
  async show() {
    const ctx = this.ctx;
    const id = ctx.params.id;
    const evaluate = await this.ctx.service.evaluate.find(id);
    ctx.body = evaluate;
  }
  async index0() {
    const ctx = this.ctx;
    const pass = ctx.params.age;
    console.log(pass);
    const data = await this.ctx.service.evaluate.findAll0(pass);
    this.ctx.body = data;
  }
}
module.exports = evaluate;
